package com.chehejia.saos.resubmitredis;

import com.chehejia.saos.resubmitredis.config.LockUtil;
import com.chehejia.saos.resubmitredis.config.RepeatSubmitAspect;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;


/**
 * 自动配置类
 *
 * @author wangyongkun
 * @create 2021/3/4
 */
@Configuration
@ConditionalOnMissingBean(StringRedisTemplate.class)
public class DuplicateSubmitAutoConfigure {
    public DuplicateSubmitAutoConfigure() {
    }

    @Bean
    public RepeatSubmitAspect submitAspect() {
        return new RepeatSubmitAspect();
    }

    @Bean
    public LockUtil lockUtil(){
        return new LockUtil();
    }


}
